package homework2;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class HomeWork {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入“编号#姓名#年龄”");
        String str = null;
        String[] arr = new String[3];
        Set<Student> set = new HashSet<>();
        while(true){
            str = scan.next();
            if (str.equals("exit")){
                System.out.println("退出！");
                break;

            }
            arr = str.split("#");
           Student stu = new Student(Integer.parseInt(arr[0]),arr[1],Integer.parseInt(arr[2]));
            System.out.println(stu);
            set.add(stu);
        }
        System.out.println(set);
    }
}

